<!--
 * 档案字段模板 查询组件
 * :
 * @version: 1.0
 * @author: lakeside hubin_yuan.410@hotmail.com
 * @date: 20120-07-14
 * @LastEditors:
 * @LastEditTime:
 -->
<template>
  <el-form ref="fieldTmplSearchForm" :model="search.criteria" :rules="rules" label-position="right" label-width="6rem">
    <el-row justify="center" type="flex"><span class="p-1 span_tag">需要根据索引调整可支持的查询字段</span></el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="通用搜索" prop="remarkNote">
          <el-input v-model="search.criteria.filter" autocomplete="off" clearable
                    placeholder="支持【空】模糊搜索"></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="数据类型" prop="dataType">
          <el-input v-model="search.criteria.dataType"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="时间格式" prop="datePattern">
          <el-input v-model="search.criteria.datePattern"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="时间视图" prop="dateView">
          <el-input v-model="search.criteria.dateView"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="默认值" prop="defaultValue">
          <el-input v-model="search.criteria.defaultValue"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="属性规则" prop="attributeRules">
          <el-input v-model="search.criteria.attributeRules"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="字段标题" prop="fieldLabel">
          <el-input v-model="search.criteria.fieldLabel"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="字段模型" prop="fieldModel">
          <el-input v-model="search.criteria.fieldModel"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="表列名" prop="tableColumn">
          <el-input v-model="search.criteria.tableColumn"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="实体属性名" prop="entityProperty">
          <el-input v-model="search.criteria.entityProperty"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="字段提示" prop="fieldTip">
          <el-input v-model="search.criteria.fieldTip"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="校验规则" prop="verifyRules">
          <el-input v-model="search.criteria.verifyRules"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="表单列序" prop="formCol">
          <el-input-number v-model="search.criteria.formCol" :controls="false"></el-input-number>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="表单宽度" prop="formWidth">
          <el-input-number v-model="search.criteria.formWidth" :controls="false"></el-input-number>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="表单行序" prop="formRow">
          <el-input-number v-model="search.criteria.formRow" :controls="false"></el-input-number>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="表单类型" prop="formType">
          <el-input v-model="search.criteria.formType"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="是否标准字段" prop="hasBasic">
          <el-switch v-model="search.criteria.hasBasic"></el-switch>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="是否固定" prop="hasFixed">
          <el-switch v-model="search.criteria.hasFixed"></el-switch>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="是否内部配置" prop="hasInside">
          <el-switch v-model="search.criteria.hasInside"></el-switch>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="是否多选" prop="hasMultiple">
          <el-switch v-model="search.criteria.hasMultiple"></el-switch>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="选项字典主键" prop="optionDict">
          <el-input v-model="search.criteria.optionDict"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="结构选项" prop="optionStruct">
          <el-input v-model="search.criteria.optionStruct"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="上级主键" prop="parentId">
          <el-input v-model="search.criteria.parentId"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="显示场景" prop="displayArea">
          <el-input v-model="search.criteria.displayArea"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="门类主键" prop="categoryId">
          <el-input v-model="search.criteria.categoryId"
                    autocomplete="off" placeholder=""></el-input>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <el-col :lg="12" :md="24">
        <el-form-item label="创建者" prop="createdByName">
          <el-input v-model="search.criteria.createdByName" autocomplete="off"></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="12" :md="24">
        <el-form-item label="最后修改者" prop="modifiedByName">
          <el-input v-model="search.criteria.modifiedByName" autocomplete="off"></el-input>
        </el-form-item>
      </el-col>
      <el-col :lg="24" :md="24">
        <el-form-item label="创建时间" prop="createdDate">
          <el-date-picker v-model="search.criteria.createdDate" align="l" end-placeholder="结束日期"
                          format="yyyy-MM-dd HH:mm:ss" range-separator="至"
                          start-placeholder="开始日期" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col :lg="24" :md="24">
        <el-form-item label="最后修改时间" prop="modifiedDate">
          <el-date-picker v-model="search.criteria.modifiedDate" align="l" end-placeholder="结束日期"
                          format="yyyy-MM-dd HH:mm:ss" range-separator="至"
                          start-placeholder="开始日期" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss">
          </el-date-picker>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row>
      <!--<el-col :md="24" :lg="24">
          <el-form-item label="备注描述" prop="remarkNote">
              <el-input type="textarea" :autosize="{minRows: 2}" v-model="search.criteria.remarkNote"autocomplete="off"></el-input>
          </el-form-item>
      </el-col>-->
      <el-col :lg="12" :md="24">
        <el-form-item label="有效状态" prop="validStatus">
          <dict-option-select v-model="search.criteria.validStatus" :dictField="this.$constants.coreDict.validStatus.key"
                              autocomplete="off"
                              multiple placeholder=""></dict-option-select>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
import DictOptionSelect from "@/views/system/components/DictOptionSelect";

export default {
  name: "dossierFieldTmplSearch",
  model: {
    prop: 'search',
  },
  props: {
    search: {type: Object},
  },
  components: {DictOptionSelect},
  data() {
    return {
      rules: {
        dataType: [
          {max: 20, message: '数据类型最大长度为20', trigger: ['blur', 'change']},
        ],
        datePattern: [
          {max: 20, message: '时间格式最大长度为20', trigger: ['blur', 'change']},
        ],
        dateView: [
          {max: 20, message: '时间视图最大长度为20', trigger: ['blur', 'change']},
        ],
        defaultValue: [
          {max: 50, message: '默认值最大长度为50', trigger: ['blur', 'change']},
        ],
        attributeRules: [
          {max: 65535, message: '属性规则最大长度为65535', trigger: ['blur', 'change']},
        ],
        fieldLabel: [
          {max: 20, message: '字段标题最大长度为20', trigger: ['blur', 'change']},
        ],
        fieldModel: [
          {max: 20, message: '字段模型最大长度为20', trigger: ['blur', 'change']},
        ],
        fieldName: [
          {max: 20, message: '字段名称最大长度为20', trigger: ['blur', 'change']},
        ],
        fieldTip: [
          {max: 200, message: '字段提示最大长度为200', trigger: ['blur', 'change']},
        ],
        verifyRules: [
          {max: 65535, message: '校验规则最大长度为65535', trigger: ['blur', 'change']},
        ],
        formCol: [
          {type: 'integer', message: '表单列序必须为数字整数', trigger: ['blur', 'change']},
        ],
        formWidth: [
          {type: 'integer', message: '表单宽度必须为数字整数', trigger: ['blur', 'change']},
        ],
        formRow: [
          {type: 'integer', message: '表单行序必须为数字整数', trigger: ['blur', 'change']},
        ],
        formType: [
          {max: 20, message: '输入类型最大长度为20', trigger: ['blur', 'change']},
        ],
        hasBasic: [],
        hasFixed: [],
        hasInside: [],
        hasMultiple: [],
        optionDict: [
          {max: 36, message: '选项字典主键最大长度为36', trigger: ['blur', 'change']},
        ],
        optionStruct: [
          {max: 20, message: '结构选项最大长度为20', trigger: ['blur', 'change']},
        ],
        parentId: [
          {max: 36, message: '上级主键最大长度为36', trigger: ['blur', 'change']},
        ],
        visibleScene: [
          {max: 65535, message: '显示场景最大长度为65535', trigger: ['blur', 'change']},
        ],
        categoryId: [
          {max: 20, message: '门类主键最大长度为20', trigger: ['blur', 'change']},
        ],
      }
    }
  },
  methods: {
    /**表单校验回调*/
    async validate(callback) {
      return await this.$refs.fieldTmplSearchForm.validate(callback)
    },
  }
}
</script>

<style lang="scss" scoped>

</style>
